﻿#region
using System;
using System.Threading;
using System.Windows.Forms;
using Y2M.Components;
using Y2M.Forms;
using Y2M.Properties;

#endregion

namespace Y2M
{
    internal static class Program
    {
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            RunTimeChecker.IsRunTime = true;

            if (string.IsNullOrEmpty(Settings.Default.DownloadRoot))
                Settings.Default.DownloadRoot = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            Application.ThreadException += Application_ThreadException;
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

//            Application.Run(new MainForm());
            Application.Run(new MainForm2());
        }

        private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            MessageBox.Show(e.Exception.Message);
        }
    }
}